package com.tony.study.designMode.DM5_建造者模式.DM5;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Title: Cake
 * @Auther: 皮蛋布丁
 * @Date: 2021/11/01/21:09
 * @Description: 蛋糕类
 */
public class Cake {

    /**
     * 制作一个蛋糕所需要的所有工序/或一个产品所有组成部分的实现
     */
    private List<String> parts = new ArrayList<>();

    public Cake(){}

    public List<String> getParts() {
        return parts;
    }

    public void setParts(List<String> parts) {
        this.parts = parts;
    }

    public void addProcess(String process) {
        this.parts.add(process);
    }

    public void show() {
        System.out.println("先生您好，香喷喷的蛋糕制作流程如下：");
        for (String part : parts) {
            System.out.println(part);
        }
    }
}
